package org.java.auth.vo;

import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;
@Getter
@Setter
public class SecurityUserDetails extends User {

    private String id;
    private String name;
    private String loginName;
    private String mobilePhone;
    private String email;

    public SecurityUserDetails(org.java.user.api.domain.User user, Collection<? extends GrantedAuthority> authorities){
        super(user.getId(),
                user.getPassword(),
                user.isEnabled(),
                user.isAccountNonExpired(),
                user.isPasswordNonExpired(),
                user.isAccountNonLocked(),
                authorities
                );
        this.id = user.getId();
        this.name = user.getName();
        this.loginName = user.getLoginName();
        this.mobilePhone = user.getMobilePhone();
        this.email = user.getEmail();
    }



}
